import React, { Component } from 'react'
import '../css/Understand.scss'
import { BrowserRouter as Router, Route, Link, withRouter } from "react-router-dom";
import Survey from './understand/understandSurvey'
import Core from './understand/Understandcore'
export default class Understand extends Component {
  constructor(){
    super()
    this.state = {
      tabCar : true
    }
  }
  render() {
    return (
      <Router>
      <div className="_Understand_us">
        <div className="_Understand_us_left">
          <ul>
            <li onClick={this.tabCarClick.bind(this,'1')} className={this.state.tabCar ? 'tabCar' : ''}><Link to='/HomePage2/survey'>公司概况</Link></li>
            <li onClick={this.tabCarClick.bind(this,'2')} className={this.state.tabCar ? '' : 'tabCar'}><Link to='/core'>新闻中心</Link></li>
          </ul>
        </div>
        <div className="_Understand_us_right">
          <Route path="/HomePage2/survey" component={Survey}></Route>
          <Route path="/core" component={Core}></Route>
        </div>
      </div>
      </Router>
    )
  }
  tabCarClick(ind){
    if(ind === '1'){
      this.setState({
        tabCar : true
      })
    }else{
      this.setState({
        tabCar : false
      })
    }
  }
}
